package com.flashcash.solu.view.me;

import android.content.Intent;
import android.view.View;
import android.webkit.WebView;
import android.widget.ImageButton;
import android.widget.TextView;

import com.flashcash.solu.R;
import com.flashcash.solu.app.base.BaseActivity;
import com.flashcash.solu.view.me.presenter.HelpCenterActPreImp;
import com.flashcash.solu.view.me.presenter.HelpCenterActPresenter;

import butterknife.BindView;
import butterknife.OnClick;

public class HelpCenterActivity extends BaseActivity<HelpCenterActPresenter> implements HelpCenterActView {
    @BindView(R.id.id_imagebutton_info_list)
    ImageButton mIdImagebuttonInfoList;

    @Override
    protected int getLayoutResId() {
        return R.layout.activity_help_center;
    }

    @Override
    protected void init() {
        Intent intent = getIntent();
        String helpCenterUrl = intent.getStringExtra("helpCenterUrl");

        ((TextView)findViewById(R.id.id_textview_title)).setText("Help Center");

        mIdImagebuttonInfoList.setVisibility(View.GONE);

        final WebView wb =  findViewById(R.id.wv);
        wb.getSettings().setAppCacheEnabled(true);
        wb.getSettings().setAppCachePath(context.getCacheDir().getAbsolutePath());
        wb.getSettings().setJavaScriptEnabled(true);
        wb.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
        wb.getSettings().setSupportZoom(true);
        wb.loadUrl(helpCenterUrl);
    }

    @Override
    protected HelpCenterActPresenter initPresenterImpl() {
        return new HelpCenterActPreImp();
    }

    @OnClick(R.id.id_imagebutton_back)
    public void backClick() {
        finish();
    }
}
